package com.biz.primus.ms.search;

import com.biz.primus.base.elasticsearch.common.CommonESRepositoryFactoryBean;
import com.biz.primus.ms.base.config.Swagger2Configuration;
import com.biz.primus.ms.search.stream.DepotUpdateSink;
import com.biz.primus.ms.search.stream.ProductIndexSink;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.context.annotation.Import;
import org.springframework.data.elasticsearch.repository.config.EnableElasticsearchRepositories;

/**
 * @author david-liu
 */
@SpringCloudApplication
@EnableFeignClients
@EnableEurekaClient
@Import({
        Swagger2Configuration.class
})
@EnableElasticsearchRepositories(basePackages = {"com.biz.primus.base.elasticsearch"},
        repositoryFactoryBeanClass = CommonESRepositoryFactoryBean.class)
@EnableBinding({
        DepotUpdateSink.class, ProductIndexSink.class
})
public class SearchServiceApplication {
    public static void main(String[] args) {
        SpringApplicationBuilder springApplicationBuilder = new SpringApplicationBuilder(SearchServiceApplication.class);
        springApplicationBuilder.web(true).run(args);
    }
}
